package org.fusionide.builder.parsers.cfml.tags;

import java.util.Vector;

import org.fusionide.builder.parsers.cfml.CFMLTag;
import org.fusionide.builder.parsers.cfml.Variable;


public class CFPage extends CFMLTag {

	public CFPage() {
		super("", 0);
	}

	public CFPage(String attributes, int lineNumber) {
		super(attributes, lineNumber);
	}

	@Override
	public boolean requiresClosingTag() {
		return true;
	}

	@Override
	public boolean acceptsChildren(CFMLTag tag) {
		return true;
	}

	@Override
	public Vector<Variable> getVariables(int offset) {
		Vector<Variable> vars = new Vector<Variable>();

		vars.add(new Variable("server", getEndLine(), true, Variable.struct));
		vars.add(new Variable("application", getEndLine(), true, Variable.struct));
		vars.add(new Variable("session", getEndLine(), true, Variable.struct));
		vars.add(new Variable("client", getEndLine(), true, Variable.struct));
		vars.add(new Variable("cookie", getEndLine(), true, Variable.struct));
		vars.add(new Variable("request", getEndLine(), true, Variable.struct));
		vars.add(new Variable("attributes", getEndLine(), true, Variable.struct));
		vars.add(new Variable("caller", getEndLine(), true, Variable.struct));
		vars.add(new Variable("form", getEndLine(), true, Variable.struct));
		vars.add(new Variable("url", getEndLine(), true, Variable.struct));
		vars.add(new Variable("cgi", getEndLine(), true, Variable.struct));
		vars.add(new Variable("error", getEndLine(), true, Variable.struct));
		vars.add(new Variable("variables", getEndLine(), true, Variable.struct));

		vars.addAll(super.getVariables(offset));

		return collapseVariableScope(vars);
	}
}
